import React from 'react'
import './my.css'
//import pic from './image/my.jpg'
import { BrowserRouter as Router, Redirect, Route, NavLink, Switch } from 'react-router-dom';

class Mymsgsetnamesig extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
			pic: ''
  	    };
    }
	componentDidMount() {
		this.setState({
			pic:this.props.location.state.data.pic
		})
	}
    render() {
		//console.log(this.state.res);
		let list = this.state.res;
		//console.log(list);
		// 获取昵称
		var name = this.props.location.state.data.name;
		// 获取个性签名
		var signature = this.props.location.state.data.signature;
		var userid = this.props.location.state.data.userid;
		
		return (
        <div>
        	<div className='Mymsgsetnamesig-top'>
        		<span className='my-return' onClick={() => this.props.history.goBack()}>&lt;</span>
        		<span className='my-setnamesig-top'>设置个人信息</span>
        	</div>
        	
        	<NavLink to={{pathname:'/Changepic',state:{userid}}}>
        		<div id='Mymsgsetpic-box'>
        			<img id='imgt' src={this.state.pic} className='my-pic myset-pic'/>
        		</div>
        	</NavLink>
        	<NavLink to={{pathname:'/Changename',state:{userid}}}>
        		<div className='my-kuang'>
        			<span className='my-kuang-lefttxt'>昵称</span>
        			<span className='my-kuang-mid-txt'>{name}</span>
        			<span className='my-kuang-right'>&gt;</span>
        		</div>
        	</NavLink>
        	
        	<NavLink to={{pathname:'/Changesig',state:{userid}}}>
        		<div className='my-kuang'>
        			<span className='my-kuang-lefttxt'>签名</span>
        			<span className='my-kuang-mid-txt'>{signature}</span>
        			<span className='my-kuang-right'>&gt;</span>
        		</div>
        	</NavLink>
        </div>
    );
  }
}
export default Mymsgsetnamesig
